home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / PowerFantasm™ 4.05 / F4_EXAMPLES / PPC_Graphics_demo / graph_demo_init.s next >
Encoding:
Text File  |  1996-06-21  |  1.2 KB  |  48 lines  |  [TEXT/edF6]

  1. *******************************
  2. **Fantasm V4 PowerPC demo #1
  3. **Opens two windows and runs various graphical tests
  4. **
  5. **File:graph_demo_init.s
  6. **Date: 3rd Dec.95
  7. **©Lightsoft 1995.
  8. param1:    reg    r3        *Set up the names of the regs used for parameter passing
  9. param2:    reg    r4
  10. param3: reg    r5
  11. param4:    reg    r6
  12. bss:    reg    r30        *The register we use for global data
  13.     
  14. graph_demo_init:
  15.     mflr    r29    *save return address
  16.     bl    open_window
  17.     mtlr    r29
  18.     blr
  19.     
  20. open_window:
  21.     mflr    r28
  22.     li    `param1,128    *windows id is 128
  23.     li    `param2,0    *clear param2 - storage
  24.     li    `param3,-1    *behind
  25.     Xcall    GetNewCWindow    *Note NewCWindow, else we'd have problems with the colors.        
  26.     stw    `param1,window_1_ptr(`bss)
  27. **get the viewable rectangle (top,left,bottom,right)
  28.     la    r3,16(r3)    *windoptr+16=viewrect
  29.     la    r4,viewrect_1(`bss)
  30. **Copy 2 words using fpu 64 bit regs (note that this will cause a stall and the lfd should
  31. **be moved up a bit.)
  32.     lfd    f0,(r3)        *64 bit move into f0
  33.     stfd    f0,(r4)        *64 bit store into viewrect_1 (cool or what!)
  34. **And copy to our second rectangle as well
  35.     la    r4,viewrect_2(`bss)
  36.     stfd    f0,(r4)        *into viewrect_2    
  37.  
  38. **set the port to our window
  39.     lwz    `param1,window_1_ptr(`bss)
  40.     Xcall    SetPort    
  41.     lwz    r10,white(rtoc)
  42.     mtlr    r28
  43.     blr
  44.  
  45. ****
  46.     global    graph_demo_init
  47.     extern_data    white
  48.